import moment from 'moment'
import { ElMessage } from 'element-plus'
export const Time = (time) => {
    const stamp = new Date(time)
    const newTime = moment(stamp).format('YYYY-MM-DD hh:mm:ss')
    return newTime
}

export const Try = (data) => {
    try {
        data()
    } catch (err) {
        console.log(err)
        const message = err instanceof Error ? err.message : err
        ElMessage.error(message)
    }
}

